local skel = fk.CreateSkill {
  name = "emo__shifang",
}

Fk:loadTranslationTable{
  ["emo__shifang"] = "拾芳",
  [":emo__shifang"] = "当你使用基本牌后，若手牌中颜色数等于本回合你造成的伤害量，你可以摸一张牌。",

  ["$emo__shifang1"] = "新婚燕尔，自当快去快回！",
  ["$emo__shifang2"] = "良辰吉日，岂能徒增刀兵？",
}

skel:addEffect(fk.CardUseFinished, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    if target == player and player:hasSkill(skel.name) and data.card.type == Card.TypeBasic then
      local n = 0
      player.room.logic:getActualDamageEvents(1, function(e)
        if e.data.from == player then
          n = n + e.data.damage
        end
        return n > 2
      end)
      if n > 2 then return false end
      local colors = {}
      for _, id in ipairs(player:getCardIds("h")) do
        local color = Fk:getCardById(id).color
        if color ~= Card.NoColor then
          table.insertIfNeed(colors, color)
          if #colors == 2 then break end
        end
      end
      return #colors == n
    end
  end,
  on_use = function (self, event, target, player, data)
    player:drawCards(1, skel.name)
  end,
})

return skel
